<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php
        require ('./_app/Config.inc.php');
        $Atual = filter_input(INPUT_GET, 'atual', FILTER_VALIDATE_INT);
        //echo $Atual;
        $Pager = new Pager('04-gestao-de-resultados.php?atual=', 'Primeira', 'Ultima', '1');
        $Pager->ExePager($Atual, 1);
        
        $read = new Read;
        $read->ExeRead('ws_categories', 'LIMIT :limit OFFSET :offset', "limit={$Pager->getLimit()}&offset={$Pager->getOffset()}");
        
        if(!$read->getRowCount()):
            $Pager->ReturnPage();
            echo "Nao existem resultados!<hr>";
        else:
            var_dump($read->getResult());
        endif;
        
        $Pager->ExePaginator('ws_categories');
        echo $Pager->getPaginator();
        ?>
    </body>
</html>
